import axios from '../axiosAPI'
export default {
    // 所有权限列表
    getRightList(rightsList) {
        return axios.get("rights/list", rightsList)
    },
    //左侧权限列表
    leftMensList(menuList) {
        return axios.get('menus', menuList)
    },
    // 获取角色信息
    getRolesList() {
        return axios.get('roles')
    },
    // 添加角色
    addRoles(RolesInfo) {
        return axios.post('roles', RolesInfo)
    },
    // 查询用户信息
    queryRolesInfo(id) {
        return axios.get(`roles/${id}`)
    },
    // 编辑用户信息
    updataRolesInfo(id) {
        return axios.put(`roles/${id}`)
    },
    // 删除角色信息
    deleteRolesInfo(id) {
        return axios.delete(`roles/${id}`)
    },
    // 分配权限信息
    allotRights(roleId, idStr) {
        return axios.post(`roles/${roleId}/rights`, idStr)
    },
    // 删除角色指定权限
    removeRightsById(roleId, rightId) {
        return axios.delete(`roles/${roleId}/rights/${rightId}`)
    }
}